#include<stdio.h>
#include<unistd.h>
#define NUM 100
#include<string.h>


int main()
{
    char bar[NUM];
    memset(bar, 0 ,sizeof(bar));
    const char *a = "|/-\\";
    int cat = 0;
    while(cat <= 100)
    {
        printf("[%-100s][%d%%] %c\r",bar, cat, a[cat % 4]);
        bar[cat++]='#';
        
        fflush(stdout);
        usleep(30000);
    }
    return 0;
}
